1. Field of the Invention
The present invention generally relates to a rotary body position control apparatus. In particular, it relates to an apparatus for properly stopping a main shaft of a machine tool at a predetermined position.
2. Background Art
FIG. 5 is a schematic diagram showing the conventional rotary body position control apparatus. In the drawing, a control apparatus 1 constitutes a feedback control system. The control apparatus 1 controls the rotational speed of a motor 2. To a motor shaft 3 of the motor 2 is connected a toothed wheel 4. Another toothed wheel 5 is geared with the first toothed wheel 4. A rotary shaft 6 connected to the second toothed wheel 5 acts as a main shaft of a machine tool. A magnet 7 is mounted on the rotary shaft 6 at its outer peripheral portion. A position detector 8 is fixed in opposition to the magnet 7 for producing two kind of voltages in accordance with magnetic flux generated by the magnet 7. A pulse encoder 9 produces pulses in accordance with the rotational speed of the motor 2.
FIG. 6 is a block diagram showing in detail the arrangement of this conventional rotary body position control apparatus. In FIG. 6, elements corresponding to those of FIG. 5 are correspondingly referenced, and the remaining elements are arranged as follows. That is, a microcomputer 10 is provided with a ROM, RAM, and a buffer, the functions of the microcomputer 10 except for switches being illustrated by blocks. An A/D converter 11 converts a first output 8a of the position detector 8 into a digital signal of N bits (for example, 8 bits). A voltage detector 12 converts a level of a second output 8b of the position detector to a logical level signal. A position control circuit 13 calculates a speed command for the motor 2 on the basis of output signals from the A/D converter 11 and the voltage detector 12. A speed detection circuit 14 counts the number of output pulses of the pulse encoder 9 so as to produce a speed feedback signal of N bits. A speed control circuit 15 calculates a deviation of the speed feedback signal produced from the speed detection circuit 14 from the speed command produced from the position control circuit 13 so as to apply a speed control signal to the motor 2. A first speed command 16 used for deceleration has a higher instructed speed than a second speed command 17, also used for deceleration. A stop position command 18 instructs a stop position. A speed-attainment detection circuit 19 produces a signal of an "H" level when the first speed command 16 coincides with the speed feedback signal. A gear-ratio reading circuit reads a gear setting value 22. A timer reading circuit 21 reads a timer setting valve 23, SW1 to SW6 are control switches which are used in various places in the position control circuit 13.
Referring to FIGS. 7 and 8, the operation of the thus arranged conventional rotary body position control apparatus will be described hereunder.
Upon reception a speed control signal from the control apparatus 1, the motor 2 rotates so that the rotary shaft 6 is driven at a speed determined by the ratio of the number of teeth, that is, the gear ratio of the first toothed wheel 4 to the second toothed wheel 5. At that time, magnetic flux generated by the magnet 7 mounted on the rotary shaft 6 is detected by the position detector 8, so that a voltage signal is applied to the control apparatus 1 in accordance with a rotational or angular position of the magnet 7. Pulse signals of the number corresponding to the rotational speed of the motor 2 are also applied to the control apparatus from the pulse encoder 9. Then, the control apparatus 1 compares a speed feedback signal obtained by counting the number of pulses of the pulse encoder 9 with a speed command obtained on the basis of the voltage signal from the position detector 8, and applies a speed control signal to the motor 2 so as to zero a difference between the speed command and the speed feedback signal to thereby to cause the rotary shaft 6 to stop at a predetermined position.
The position detector 8 produces a voltage signal 8a which becomes zero in voltage as shown in FIG. 7A when the center of the position detector 8 coincides with the center of the magnet 7 and becomes a maximum or a minimum when the center of the position detector 8 coincides with an end of the magnet 7. The position detector 8 also produces another voltage signal 8b which becomes fixed at a positive value as shown in FIG. 7B as long as the center of the position detector 8 is opposite to the magnet 7. The voltage signal 8a is converted into a digital signal of N bits by the A/D converter 11 and the voltage signal 8b is converted into a signal having a "H" level in a positive period of the signal 8b by the voltage detector 12. These voltage signals 8a and 8b are then applied to the position control circuit 13. Therefore, when the motor 2 is rotated at an ordinary rotational speed as shown in FIG. 8A, the position detector 8 produces the voltage signals 8a and 8b each having a predetermined period as shown in FIGS. 8B and 8C, respectively.
Upon application of a predetermined position stopping command for the rotary shaft 6, the switches SW.sub.1 and SW.sub.2 in the position control circuit 13 are closed to apply the first speed command 16 instructing a first deceleration speed, which is a speed less than a normal one, to the speed control circuit 15. At the same time the gear-ratio setting value 22 is read by the gear-ratio setting reading circuit 20, so that a first position servo loop control is performed. That is, the motor 2 is decelerated to a first reduced speed. When the motor 2 has reached the first deceleration speed at a timing t.sub.1 of FIG. 8, the speed feedback signal from the speed detection circuit 14 coincides with the first speed command 16 and the speed-attainment detection circuit 19 detects this coincidence so as to close the switch SW.sub.5 at the timing of the respective leading edges of the signals.
The output signal 8b from the voltage detector 12 is applied to the position control circuit 13 through the thus closed switch SW.sub.5, so that the timer reading circuit 21 reads the timer setting value 23 at a timing of the transition of the output signal 8b of the voltage detector 12 towards a level "L", that is, at a timing t.sub.2 when the magnet 7 passes by the position detector 8. During the running of the timer, the motor continues turning at the first speed.
The switches SW.sub.1 and SW.sub.2 are opened and the switches SW.sub.3 and SW.sub.4 are closed at a timing t.sub.3 after the setting time has elapsed. As a result, the second speed command 17 instructing a second deceleration speed smaller than the first speed instructed by the first speed command 16 is applied to the speed control circuit 15. At the same time, the gear-ratio setting value 22 is read by the gear-ratio reading circuit 20, so that the first position servo loop control is replaced by a second one. Thus, the motor 2 is decelerated to reach the second deceleration speed. After the second deceleration speed has been reached, the switch SW.sub.6 is closed at a timing t.sub.4 when the voltage signal 8a becomes a maximum and the voltage signal 8b rises in the positive direction, that is, the center of the magnet 7 reaches the end of position detector 8. As a result, the position control circuit 13 produces a speed command for stopping the motor 2 on the basis of the difference between the stop position command 18 (assumed here to be zero volts) and the output signal of the position detector 8, so that the speed control circuit 15 controls the speed of the motor 2 to stop the rotary shaft 6 at a position where the output signal 8a of the position detector 8 becomes just zero (volts).
As described above, in the conventional rotary body position control apparatus, the timer setting value is read at the timing t.sub.2 when the voltage signal 8b falls negatively after the motor 2 has reached the first deceleration speed, and the motor 2 is changed over into the second deceleration speed after the timer setting value has elapsed.
Therefore, if the timer setting value is too small, the motor 2 is prematurely changed over into the second deceleration speed, so that the duration in which the motor 2 is being rotated at the second deceleration speed is prolonged and the time taken for positioning the rotary shaft is lengthened.
If the timer setting value is set too large, on the other hand, there is a possibility that the motor 2 has not yet been changed over from the first deceleration speed to the second one even if the stopping point has been reached, so that the rotary shaft may overshoot the target stopping position to make it impossible to perform a smooth positioning operation of the rotary shaft.
The foregoing disadvantage is due to not only to the timer setting value but a change in first deceleration speed, and therefore there has been such a problem that the timer setting value is required to be changed every time the first deceleration speed is changed.